<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-内容管理-文章管理|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
<!--/***** 当前页css  start *****/-->
<!--/***** 当前页css  end *****/-->
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=content,child=info)">菜单栏</div>
		<!--/*******内容*******/-->
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>内容管理</cite></a><a><cite>文章管理</cite></a>
					</span>
				</div>
				<div class="site-tree">
					<ul class="layui-tree" id="nodeTree">
					</ul>
				</div>
				<div class="site-content" style="width: 1399px;" id="infoContent"></div>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部版权信息等</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
<!--/***** 当前页js start *****/-->
<script th:src="@{/resources/js/common/formBuilder.js}"></script>
<!--/* 模板引擎生成数据 */-->
<script th:inline="javascript">
    /*<![CDATA[*/
    //加载完成后执行
    var $ = layui.jquery;
    var jQuery = layui.jquery;
    $(function() {
        loadTreeData();
        loadInfoByNode("0");
    });
    function loadInfoByNode(nodeId) {
        $("#nodeTree li").removeClass("layui-this");
        $("#nodeTree li[id='" + nodeId + "'").addClass("layui-this");
        var infoListUrl = /*[[@{/admin/m/base/info/infoList.gsp}]]*/'';
        $("#infoContent").load(infoListUrl + '?nodeId=' + nodeId);
    }
    function loadTreeData() {
        var listUrl = /*[[@{/admin/m/base/node/list.gsp}]]*/'';
        tg_simpleAjaxPost(listUrl, null, function(d) {
            var result = $.parseJSON(d);
            var records = result.records;
            $("#nodeTree").html("");
            for (var i = 0; i < records.length; i++) {
                var record = records[i];
                var $tr = '<li class="site-tree-noicon" id="' + record.id + '" onclick="loadInfoByNode(\'' + record.id + '\')"><a href="#"><cite>' + record.noddName + '</cite></a></li>'
                $("#nodeTree").append($tr);
            }
        });
    }
    /*]]>*/
</script>
<!--/***** 当前页js end *****/-->
</html>